import os
import shutil

from setuptools.glob import glob


def my_copyfile(srcfile, dstpath):
    if not os.path.isfile(srcfile):
        print("%s not exist!" % (srcfile))
    else:
        fpath, fname = os.path.split(srcfile)
        if not os.path.exists(dstpath):
            os.makedirs(dstpath)
        shutil.copy(srcfile, dstpath + fname)
        print("copy %s -> %s" % (srcfile, dstpath + fname))


src_dir = '/home/libraly/CLionProjects/c0/cmake-build-debug/'
dst_dir = '/mnt/hgfs/share/Interpreter/cmake-build-debug/'
src_file_list = glob(src_dir + 'fa.txt')
for srcfile in src_file_list:
    my_copyfile(srcfile, dst_dir)

dst_dir = '/mnt/hgfs/share/Interpreter/out/build/x64-Debug/'
src_file_list = glob(src_dir + 'fa.txt')
for srcfile in src_file_list:
    my_copyfile(srcfile, dst_dir)
